<template>
  <div class="error-page">
    <div class="error-content">
      <div class="error-icon">🔒</div>
      <h1>403</h1>
      <h2>权限不足</h2>
      <p>您没有权限访问此页面</p>
      <div class="error-actions">
        <button @click="goHome" class="btn-primary">返回首页</button>
        <button @click="goBack" class="btn-secondary">返回上一页</button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/home');
};

const goBack = () => {
  router.go(-1);
};
</script>

<style lang="less" scoped>
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.error-content {
  text-align: center;
  padding: 40px 30px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  max-width: 400px;
  width: 100%;

  .error-icon {
    font-size: 48px;
    color: var(--warning-color);
    margin-bottom: 16px;
  }

  h1 {
    font-size: 48px;
    color: var(--warning-color);
    margin: 0 0 8px 0;
    font-weight: bold;
  }

  h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-weight: 600;
  }

  p {
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    font-size: 14px;
  }
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 100px;

  &:hover {
    transform: translateY(-1px);
  }
}

.btn-primary {
  background: var(--primary-color);
  color: var(--btn-text-primary);

  &:hover {
    background: var(--primary-light);
  }
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);

  &:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .error-content {
    padding: 30px 20px;
    margin: 0 10px;

    h1 {
      font-size: 36px;
    }
  }

  .error-actions {
    flex-direction: column;
    align-items: center;

    .btn-primary,
    .btn-secondary {
      width: 100%;
      max-width: 150px;
    }
  }
}
</style>